home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 23 / AMIGAplus Sonderheft 23 (2000)(Falke)(DE)[!].iso / Tools / Packer / xad / Developer / Include / C / libraries / xadmaster.h
C/C++ Source or Header  |  1999-11-06  |  20KB  |  463 lines

  1. #ifndef LIBRARIES_XADMASTER_H
  2. #define LIBRARIES_XADMASTER_H
  3.  
  4. /*
  5. **    $VER: xadmaster.h 1.1 (11.11.1998)
  6. **    xadmaster.library defines and structures
  7. **
  8. **    Copyright © 1998 by Dirk Stöcker
  9. **    All Rights Reserved.
  10. */
  11.  
  12. #ifndef EXEC_LIBRARIES_H
  13. #include <exec/libraries.h>
  14. #endif
  15.  
  16. #ifndef UTILITY_TAGITEM_H
  17. #include <utility/tagitem.h>
  18. #endif
  19.  
  20. /************************************************************************
  21. *                                                *
  22. *    library base structure                        *
  23. *                                                *
  24. ************************************************************************/
  25.  
  26. struct xadMasterBase {
  27.   struct Library       xmb_LibNode;
  28.   struct ExecBase *    xmb_SysBase;
  29.   struct DosLibrary *  xmb_DOSBase;
  30.   struct UtilityBase * xmb_UtilityBase;
  31.   ULONG               xmb_RecogSize;    /* read only */
  32. };
  33.  
  34. /************************************************************************
  35. *                                                *
  36. *    tag-function call flags                               *
  37. *                                                *
  38. ************************************************************************/
  39.  
  40. /* input tags for xadGetInfo, only one can be specified per call */
  41. #define XAD_INSIZE        (TAG_USER+  1) /* input data size */
  42. #define XAD_INFILENAME        (TAG_USER+  2)
  43. #define XAD_INFILEHANDLE    (TAG_USER+  3)
  44. #define XAD_INMEMORY        (TAG_USER+  4)
  45. #define XAD_INHOOK        (TAG_USER+  5)
  46.  
  47. /* output tags, only one can be specified per call, xadXXXXUnArc */
  48. #define XAD_OUTSIZE        (TAG_USER+ 10) /* output data size */
  49. #define XAD_OUTFILENAME        (TAG_USER+ 11)
  50. #define XAD_OUTFILEHANDLE    (TAG_USER+ 12)
  51. #define XAD_OUTMEMORY        (TAG_USER+ 13)
  52. #define XAD_OUTHOOK        (TAG_USER+ 14)
  53. #define XAD_OUTDEVICE        (TAG_USER+ 15) /* for disk archives only */
  54.  
  55. /* object allocation tags for xadAllocObjectA */
  56. #define XAD_OBJNAMESIZE        (TAG_USER+ 20) /* XADOBJ_FILEINFO, size of needed name space */
  57. #define XAD_OBJCOMMENTSIZE    (TAG_USER+ 21) /* XADOBJ_FILEINFO, size of needed comment space */
  58. #define XAD_OBJPRIVINFOSIZE    (TAG_USER+ 22) /* XADOBJ_FILEINFO & XADOBJ_DISKINOF, self use size */
  59. #define XAD_OBJBLOCKENTRIES    (TAG_USER+ 23) /* XADOBJ_DISKINFO, number of needed entries */
  60.  
  61. /* tags for xadGetInfo, xadFileUnArc and xadDiskUnArc */
  62. #define XAD_NOEXTERN        (TAG_USER+ 50) /* do not use extern clients */
  63. #define XAD_PASSWORD        (TAG_USER+ 51) /* password when needed */
  64. #define XAD_ENTRYNUMBER        (TAG_USER+ 52) /* number of wanted entry */
  65. #define XAD_PROGRESSHOOK    (TAG_USER+ 53) /* the progress hook */
  66. #define XAD_OVERWRITE        (TAG_USER+ 54) /* overwrite file ? */
  67. #define XAD_MAKEDIRECTORY    (TAG_USER+ 55) /* create directory tree */
  68. #define XAD_IGNOREGEOMETRY    (TAG_USER+ 56) /* ignore drive geometry ? */
  69. #define XAD_LOWCYLINDER        (TAG_USER+ 57) /* lowest cylinder */
  70. #define XAD_HIGHCYLINDER    (TAG_USER+ 58) /* highest cylinder */
  71.  
  72. /* input tags for xadConvertDates, only one can be passed */
  73. #define XAD_DATEUNIXUTC        (TAG_USER+ 70) /* unix date variable */
  74. #define XAD_DATEAMIGA        (TAG_USER+ 71) /* amiga date variable */
  75. #define XAD_DATEDATESTAMP    (TAG_USER+ 72) /* struct DateStamp */
  76. #define XAD_DATEXADDATE        (TAG_USER+ 73) /* struct xadDate */
  77. #define XAD_DATECLOCKDATA    (TAG_USER+ 74) /* struct ClockData */
  78. #define XAD_DATECURRENTTIME    (TAG_USER+ 75) /* input is system time */
  79.  
  80. /* output tags, there can be specified multiple tags for one call */
  81. #define XAD_GETDATEUNIXUTC    (TAG_USER+ 80) /* unix date variable */
  82. #define XAD_GETDATEAMIGA    (TAG_USER+ 81) /* amiga date variable */
  83. #define XAD_GETDATEDATESTAMP    (TAG_USER+ 82) /* struct DateStamp */
  84. #define XAD_GETDATEXADDATE    (TAG_USER+ 83) /* struct xadDate */
  85. #define XAD_GETDATECLOCKDATA    (TAG_USER+ 84) /* struct ClockData */
  86.  
  87. /************************************************************************
  88. *                                                *
  89. *    objects for xadAllocObjectA                           *
  90. *                                                *
  91. ************************************************************************/
  92.  
  93. #define XADOBJ_ARCHIVEINFO    0x0001 /* struct xadArchiveInfo */
  94. #define XADOBJ_FILEINFO        0x0002 /* struct xadFileInfo */
  95. #define XADOBJ_DISKINFO        0x0003 /* struct xadDiskInfo */
  96. #define XADOBJ_HOOKPARAM    0x0004 /* struct HookParam */
  97. #define XADOBJ_DEVICEINFO    0x0005 /* struct xadDeviceInfo */
  98. #define XADOBJ_PROGRESSINFO    0x0006 /* struct xadProgressInfo */
  99.  
  100. /************************************************************************
  101. *                                                *
  102. *    hook related stuff                                *
  103. *                                                *
  104. ************************************************************************/
  105.  
  106. #define XADHC_READ    1    /* read data into buffer */
  107. #define XADHC_WRITE    2    /* write buffer data to file/memory */
  108. #define XADHC_SEEK    3    /* seek in file */
  109. #define XADHC_INIT    4    /* initialize the hook */
  110. #define XADHC_FREE    5    /* end up hook work, free stuff */
  111. #define XADHC_ABORT    6    /* an error occured, delete partial stuff */
  112. #define XADHC_FULLSIZE    7    /* complete input size is needed */
  113.  
  114. struct xadHookParam {
  115.   ULONG xhp_Command;
  116.   ULONG xhp_CommandData;
  117.   APTR  xhp_BufferPtr;
  118.   LONG  xhp_BufferSize;
  119.   LONG  xhp_DataPos;        /* current seek position */
  120.   APTR  xhp_PrivatePtr;
  121. };
  122.  
  123. /* xadHookAccess commands */
  124. #define XADAC_READ        10    /* get data */
  125. #define    XADAC_WRITE        11    /* write data */
  126. #define XADAC_COPY        12    /* copy input to ouput */
  127. #define XADAC_INPUTSEEK        13    /* seek in input file */
  128. #define XADAC_OUTPUTSEEK    14    /* seek in output file */
  129.  
  130. /************************************************************************
  131. *                                                *
  132. *    support structures                              *
  133. *                                                *
  134. ************************************************************************/
  135.  
  136. /* Own date structure to cover all possible dates in a human friendly
  137.    format. xadConvertDates may be used to convert between different date
  138.    structures and variables. */
  139. struct xadDate {
  140.   ULONG xd_Micros;    /* values 0 to 999999     */
  141.   LONG  xd_Year;    /* values 1 to 2147483648 */
  142.   UBYTE xd_Month;    /* values 1 to 12         */
  143.   UBYTE xd_WeekDay;    /* values 1 to 7          */
  144.   UBYTE xd_Day;        /* values 1 to 31         */
  145.   UBYTE xd_Hour;    /* values 0 to 23         */
  146.   UBYTE xd_Minute;    /* values 0 to 60         */
  147.   UBYTE xd_Second;    /* values 0 to 60         */
  148. };
  149.  
  150. #define XADDAY_MONDAY        1    /* monday is the first day and */
  151. #define XADDAY_TUESDAY        2
  152. #define XADDAY_WEDNESDAY    3
  153. #define XADDAY_THURSDAY        4
  154. #define XADDAY_FRIDAY        5
  155. #define XADDAY_SATURDAY     6
  156. #define XADDAY_SUNDAY        7    /* sunday the last day of a week */
  157.  
  158. struct xadDeviceInfo { /* for XAD_OUTDEVICE tag */
  159.   STRPTR xdi_DeviceName; /* name of device */
  160.   ULONG  xdi_Unit;     /* unit of device */
  161.   STRPTR xdi_DOSName;     /* instead of Device+Unit, dos name without ':' */
  162. };
  163.  
  164. /************************************************************************
  165. *                                                *
  166. *    information structures                              *
  167. *                                                *
  168. ************************************************************************/
  169.  
  170. struct xadArchiveInfo {
  171.   struct xadClient *   xai_Client;   /* pointer to unarchiving client */
  172.   APTR               xai_PrivateClient; /* private client data */
  173.   STRPTR           xai_Password; /* password for crypted archives */
  174.   ULONG               xai_Flags;    /* read only XADAIF_ flags */
  175.   ULONG               xai_LowCyl;   /* lowest cylinder to unarchive */
  176.   ULONG               xai_HighCyl;  /* highest cylinder to unarchive */
  177.   ULONG               xai_InPos;    /* input position, read only */
  178.   ULONG               xai_InSize;   /* input size, read only */
  179.   ULONG               xai_OutPos;   /* output position, read only */
  180.   ULONG               xai_OutSize;  /* output file size, read only */
  181.   struct xadFileInfo * xai_FileInfo; /* data pointer for file arcs */
  182.   struct xadDiskInfo * xai_DiskInfo; /* data pointer for disk arcs */
  183.   struct xadFileInfo * xai_CurFile;  /* data pointer for current file arc */
  184.   struct xadDiskInfo * xai_CurDisk;  /* data pointer for current disk arc */
  185. };
  186. /* This structure is nearly complete private to either xadmaster or its
  187. clients. An application program may access for reading only xai_Client,
  188. xai_Flags, xai_FileInfo and xai_DiskInfo. For xai_Flags only XADAIF_CRYPTED
  189. is useful. All the other stuff is private and should not be accessed! */
  190.  
  191. #define XADAIB_CRYPTED        0 /* archive entries are encrypted */
  192. #define XADAIB_FILECORRUPT